
<template>
  <n-config-provider :locale :theme :date-locale="dateLocale">
    <n-dialog-provider>
      <n-message-provider>
        <router-view></router-view>
      </n-message-provider>
    </n-dialog-provider>
  </n-config-provider>
</template>

<script setup lang="ts">
 import { zhCN, dateZhCN,enUS,dateEnUS, darkTheme } from 'naive-ui';
 import { useAppStore } from './stores/app';
 import { storeToRefs } from 'pinia';
 const appStore = useAppStore();
 const { lang } = storeToRefs(appStore);
 const locale = computed(()=>{
  return lang.value === 'en' ? enUS : zhCN;
 });
 const dateLocale = computed(()=>{
  return lang.value === 'en' ? dateEnUS : dateZhCN;
 });
 const theme = computed(() => {
    return appStore.theme === 'dark' ? darkTheme : null;
});
</script>

